import { getData } from '@/api/index';

const chartStore = {

  state: {
    date: null
  },
  getters: {
    getDate: (state) => {
      return state.date;
    }
  },
  mutations: {
    //update state
    getData(state, payload) {
      state.date = payload.data.data;
    }
  },
  actions: {
    //异步
    getData({ commit }) {
      return getData().then((res) => {
        commit('getData', res);
      });
    }
  }
}
export default chartStore;